import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import enUS from 'element-plus/dist/locale/en.mjs'
import zhCN from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/dist/index.css'
import axios from 'axios'
import router from './router'
import App from './App.vue'
import './style.css'
import './api/axios' // 导入axios配置

// 设置axios默认选项
axios.defaults.baseURL = '/api'
axios.defaults.timeout = 15000
axios.defaults.withCredentials = true // 允许携带cookie

const app = createApp(App)

app.use(createPinia())
   .use(router)
   .use(ElementPlus, {
     locale: zhCN, // 使用中文
   })
   .mount('#app')
